 <div class="easyui-layout" data-options="fit:true,border:false">
 	<div region="north" style="height: 50px; border-width: 0 0 1px 0; padding: 1px">
 		{$toolbar}
 	</div>
 	<div data-options="region:'center'">
 		<table id="dg_SysTable" class="easyui-datagrid" 
				data-options="
					url: '/OA/Admin/SysTable/getPageData',
					singleSelect: true,
					method:'post',
					fit:true,
					border:false, 
					pagination: true,
					pageSize: 20,
					onClickRow: onClickRow
				">
			<thead>
				<tr>
					<th data-options="field:'id',width:60">{$id}</th>
					<th data-options="field:'tbl_name',editor:'text',width:120">{$tbl_name}</th>
					<th data-options="field:'fld_name',editor:'text',width:180">{$fld_name}</th>
					<th data-options="field:'enus',editor:'text',width:120">{$enus}</th>
					<th data-options="field:'zhcn',editor:'text',width:120">{$zhcn}</th>
					<th data-options="field:'zhtw',editor:'text',width:120">{$zhtw}</th>
				</tr>
			</thead>
		</table>
		<div id="dlg_ImportSysTable" class="easyui-dialog" title="{$import_title}" style="width:400px;height:300px;padding:2px;"        
			data-options="iconCls:'icon-add',resizable:true,modal:true,closed:true,
				buttons:[{
					text: 'Add',
					iconCls: 'icon-ok',
					handler: function(){
						importSysTable();
					}
				},{
					text: 'Cancel',
					iconCls: 'icon-cancel',
					handler: function(){
						$('#dlg_ImportSysTable').dialog('close');
					}
				}]">
			<div id="dl_SysTable" class="easyui-datalist" data-options="
	            url: '/OA/Admin/SysTable/getAllTable',
	            method: 'get',
	            groupField: 'group',
	            fit:true
	            ">
	    	</div>
	    </div>
	</div>
 </div>
 <script type="text/javascript">
 	//综合查询
 	function query_1003 () {
 		var rows = getQueryRows();
 		if(rows.length>0){
 			var parameters = JSON.stringify(rows);
            $('#dg_SysTable').datagrid({
                queryParams: { parameters: parameters }
            });
            $('#dlg_query').dialog('close');
 		}
 	}
	function save_SysTable () {
		var dg = $('#dg_SysTable');
		if (endEditing(dg)){
			var $rows = {};
			var inserted = dg.datagrid('getChanges', "inserted"); 
            var updated = dg.datagrid('getChanges', "updated"); 
            var deleted = dg.datagrid('getChanges', "deleted"); 
            if(inserted.length>0) $rows['inserted'] = JSON.stringify(inserted);
            if(updated.length>0) $rows['updated'] = JSON.stringify(updated);
            if(deleted.length>0) $rows['deleted'] = JSON.stringify(deleted);
			if($rows.inserted==undefined && $rows.updated==undefined && $rows.deleted==undefined) return;
			$.ajax({
                type: 'POST',
                datatype: 'json',
                url: '/OA/Admin/SysTable/update',
                data: $rows,
                success: function (data) {
                	reloadData($('#dg_SysTable'));
					$.messager.alert(TIP_MSG.TITLE, data.statusmessage,'info');
                }
            });
		}
	}
	function showImportForm (argument) {
		$('#dlg_ImportSysTable').dialog('open');
	}

	function importSysTable () {
		var $dl = $('#dl_SysTable');
		var row = $dl.datalist('getSelected');
		if(row){
			$.ajax({
                type: 'POST',
                datatype: 'json',
                url: '/OA/Admin/SysTable/import',
                data: {tbl_name: row.text},
                success: function (data) {
                	var msgType = data.statuscode==0?'info':'error';
                	if(data.statuscode==0){
                		reloadData($('#dg_SysTable'));
                	}
                	alert(data.statusmessage);
                	$('#dlg_ImportSysTable').dialog('close');
					//$.messager.alert(TIP_MSG.TITLE, data.statusmessage, msgType);
                }
            });
		}
	}
 </script>